Skip to content

fix(fleet-queue): fallback fetch_markers errors instead of silently truncating at 1,000 comments - #9056

Merged
dezren39 merged 1 commit into
mainfrom
queue/15337-9044-fetch-markers-truncation
Nov 13, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/15337-9044-fetch-markers-truncation

Conversation

@developing-today

@developing-today developing-today Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Closes #9044

fallback.rs fetch_markers paged issue comments 1..=10 at per_page=100 and returned Ok(markers) when the 10th page was still full -- markers past 1,000 comments were silently dropped, so a live fallback claim could read as absent (design #6622 contract rule 3: truncation is never silent).

Change

  • Extracted the page loop into collect_markers with the page fetch injected, so the bound behavior is unit-testable; fetch_markers supplies the real gh api fetch. Page size / page bound are now named constants (MARKER_PAGE_SIZE / MAX_MARKER_PAGES).
  • When the bound is reached on a full page, collect_markers returns an explicit error ("refusing to return a truncated marker set") instead of the partial set. Every existing caller already propagates fetch_markers errors (die(EXIT_TRANSPORT) / ?), so no caller changes were needed.
  • Reads under the bound are unchanged.

Tests (oracle: issue #9044 acceptance)

  • collect_markers_full_last_page_is_a_truncation_error -- ten full pages error explicitly, after exactly MAX_MARKER_PAGES fetches.
  • collect_markers_under_the_bound_is_unchanged -- full page + short page returns all markers in order, skips non-marker comments, stops at the short page; an empty first page is a complete empty read.
  • Full crate suite: cargo test -p fleet-queue --all-features --lib -- 303 passed, 0 failed (run on the laptop through fleet-build-lock).

Queue: task 15337, lane code-b.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@developing-today
developing-today Bot requested review from a team and dezren39 as code owners November 12, 2026 22:18
@coderabbitai

coderabbitai Bot commented Nov 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 413295a4-1b6a-4b3c-8007-f27d475ea4b9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(fleet-queue): fallback fetch_markers silently truncates at its 10-page bound — markers past 1,000 comments read as absent

1 participant